package com.lanou3g.code0522.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.*;

@WebListener
public class SecondListener implements HttpSessionAttributeListener {

    @Override
    public void attributeAdded(HttpSessionBindingEvent httpSessionBindingEvent) {
        System.out.println("attributeAdded");
        System.out.println(httpSessionBindingEvent.getName());
        String key = httpSessionBindingEvent.getName();
        HttpSession session = httpSessionBindingEvent.getSession();
//        session.removeAttribute(key);
    }

    @Override
    public void attributeRemoved(HttpSessionBindingEvent httpSessionBindingEvent) {

    }

    @Override
    public void attributeReplaced(HttpSessionBindingEvent httpSessionBindingEvent) {

    }
}
